class {
    onMount() {
        this.purchaseEvents = [];
    }

    handleItemPurchase(item) {
        this.purchaseEvents.push(item);
    }
}

<div>
    <for|item| of=input.items>
        <item item=item once-purchase("handleItemPurchase")/>
    </for>
</div>